﻿using CarRental.DataAccessLayer;
using CarRental.Model;
using CarRental.Resourse;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Web;

namespace CarRental.Helpers {
    public class OptionItems {
       

        public class GeneralStatus {
            public String Key { get; set; }
            public String Title { get; set; }
        };

        public class ShortGeneralStatus {
            public short Key { get; set; }
            public String Title { get; set; }
        };

        public class StatusLst : ObservableCollection<GeneralStatus> {
            public StatusLst() {
            }

            public void Add(string key, string title) {
                Add(new GeneralStatus() { Key = key, Title = title });
            }
        }

        public class ShortStatusLst : ObservableCollection<ShortGeneralStatus> {
            public ShortStatusLst() {
            }

            public void Add(short key, string title) {
                Add(new ShortGeneralStatus() { Key = key, Title = title });
            }
        }

        //public class CheckBoxValLst : StatusLst {
        //    public CheckBoxValLst() {
        //        Add("Y", Boolean.TrueString);
        //        Add("N", Boolean.FalseString);
        //    }
        //}

        public class UserStatusLst : StatusLst {
            public UserStatusLst() {
                Add("A", "Active");
                Add("T", "Terminate");
            }
        }

        public class UserTypeLst : StatusLst {
            public UserTypeLst() {
                Add("CUSTOMER", "Customer");
                Add("STAFF", "Staff");
            }
        }

        public class ColorLst : StatusLst {
            public ColorLst() {
                Add("RED", "Red");
                Add("BLUE", "Blue");
                Add("YELLOW", "Yellow");
                Add("GREEN", "Green");
                Add("PURPLE", "Purple");
                Add("WHITE", "White");
                Add("BLACK", "Black");
            }
        }

        public class ShopLst : StatusLst {
            public ShopLst() {
                Wcf _wcf = new Wcf();
                var _lst = _wcf.GetShop().ToList<shop>();
                foreach (var item in _lst) {
                    Add(item.shopcode, item.shopname);
                }

            }
        }

        public class CarTypeLst : StatusLst {
            public CarTypeLst() {
                Wcf _wcf = new Wcf();
                var _lst = _wcf.GetCarType().ToList<car_type>();
                foreach (var item in _lst) {
                    Add(item.car_typecode, item.car_type1);
                }

            }
        }

        public class DepotLst : StatusLst {
            public DepotLst() {
                Wcf _wcf = new Wcf();
                var _lst = _wcf.GetDepot().ToList<depot>();
                foreach (var item in _lst) {
                    Add(item.depot_no, item.depot_name);
                }

            }
        }

        public class DriveTrainsLst : StatusLst {
            public DriveTrainsLst() {
                Wcf _wcf = new Wcf();
                var _lst = _wcf.GetDrivetrains().ToList<drivetrain>();
                foreach (var item in _lst) {
                    Add(item.drivetrains_no, item.drivetrains);
                }

            }
        }

    }
}